/**
 * 
 */
package com.scpii.universal.hibernate.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.scpii.universal.constant.GenericConstants;
import com.scpii.universal.hibernate.dao.ModuleStyleDao;
import com.scpii.universal.hibernate.entity.ModuleStyleTab;

/**
 * genericWeb
 * @author weny
 * 2012-7-6上午10:59:22
 */
@Repository
public class ModuleStyleDaoImpl extends BaseDaoImpl<ModuleStyleTab, Integer> implements
		ModuleStyleDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<ModuleStyleTab> getAllModuleStyle(String[] properties, int parentId) {
		String hql = generateHqlByProperties(properties)
			+ "where entity.intDeleteSign=? and entity.intParentModuleStyleId=?";
		return (List<ModuleStyleTab>) getHibernateTemplate().getSessionFactory()
				.getCurrentSession().createQuery(hql).setParameter(0,
						GenericConstants.DELETE_SIGN_EXIST).setParameter(1, parentId).list();
	}

}
